//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS LicenseManagerUserSubscriptions service.
///
/// With License Manager, you can create user-based subscriptions to utilize licensed software with
/// 		a per user subscription fee on Amazon EC2 instances.
public struct LicenseManagerUserSubscriptions: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the LicenseManagerUserSubscriptions client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "LicenseManagerUserSubscriptions",
            serviceIdentifier: "license-manager-user-subscriptions",
            serviceProtocol: .restjson,
            apiVersion: "2018-05-10",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: LicenseManagerUserSubscriptionsErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "us-east-1": "license-manager-user-subscriptions-fips.us-east-1.amazonaws.com",
            "us-east-2": "license-manager-user-subscriptions-fips.us-east-2.amazonaws.com",
            "us-west-1": "license-manager-user-subscriptions-fips.us-west-1.amazonaws.com",
            "us-west-2": "license-manager-user-subscriptions-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Associates the user to an EC2 instance to utilize user-based subscriptions.  Your estimated bill for charges on the number of users and related costs will take 48
    /// 			hours to appear for billing periods that haven't closed (marked as Pending billing status) in Amazon Web Services Billing. For more information, see Viewing your
    /// 				monthly charges in the Amazon Web Services Billing User Guide.
    @Sendable
    @inlinable
    public func associateUser(_ input: AssociateUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> AssociateUserResponse {
        try await self.client.execute(
            operation: "AssociateUser", 
            path: "/user/AssociateUser", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Associates the user to an EC2 instance to utilize user-based subscriptions.  Your estimated bill for charges on the number of users and related costs will take 48
    /// 			hours to appear for billing periods that haven't closed (marked as Pending billing status) in Amazon Web Services Billing. For more information, see Viewing your
    /// 				monthly charges in the Amazon Web Services Billing User Guide.
    ///
    /// Parameters:
    ///   - domain: The domain name of the  Active Directory that contains information for the user to associate.
    ///   - identityProvider: The identity provider for the user.
    ///   - instanceId: The ID of the EC2 instance that provides the user-based subscription.
    ///   - tags: The tags that apply for the user association.
    ///   - username: The user name from the identity provider.
    ///   - logger: Logger use during operation
    @inlinable
    public func associateUser(
        domain: String? = nil,
        identityProvider: IdentityProvider,
        instanceId: String,
        tags: [String: String]? = nil,
        username: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> AssociateUserResponse {
        let input = AssociateUserRequest(
            domain: domain, 
            identityProvider: identityProvider, 
            instanceId: instanceId, 
            tags: tags, 
            username: username
        )
        return try await self.associateUser(input, logger: logger)
    }

    /// Creates a network endpoint for the Remote Desktop Services (RDS) license server.
    @Sendable
    @inlinable
    public func createLicenseServerEndpoint(_ input: CreateLicenseServerEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateLicenseServerEndpointResponse {
        try await self.client.execute(
            operation: "CreateLicenseServerEndpoint", 
            path: "/license-server/CreateLicenseServerEndpoint", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a network endpoint for the Remote Desktop Services (RDS) license server.
    ///
    /// Parameters:
    ///   - identityProviderArn: The Amazon Resource Name (ARN) that identifies the IdentityProvider resource that contains details
    ///   - licenseServerSettings: The LicenseServerSettings resource to create for the endpoint. The
    ///   - tags: The tags that apply for the license server endpoint.
    ///   - logger: Logger use during operation
    @inlinable
    public func createLicenseServerEndpoint(
        identityProviderArn: String,
        licenseServerSettings: LicenseServerSettings,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateLicenseServerEndpointResponse {
        let input = CreateLicenseServerEndpointRequest(
            identityProviderArn: identityProviderArn, 
            licenseServerSettings: licenseServerSettings, 
            tags: tags
        )
        return try await self.createLicenseServerEndpoint(input, logger: logger)
    }

    /// Deletes a LicenseServerEndpoint resource.
    @Sendable
    @inlinable
    public func deleteLicenseServerEndpoint(_ input: DeleteLicenseServerEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteLicenseServerEndpointResponse {
        try await self.client.execute(
            operation: "DeleteLicenseServerEndpoint", 
            path: "/license-server/DeleteLicenseServerEndpoint", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a LicenseServerEndpoint resource.
    ///
    /// Parameters:
    ///   - licenseServerEndpointArn: The Amazon Resource Name (ARN) that identifies the LicenseServerEndpoint
    ///   - serverType: The type of License Server that the delete request refers to.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteLicenseServerEndpoint(
        licenseServerEndpointArn: String,
        serverType: ServerType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteLicenseServerEndpointResponse {
        let input = DeleteLicenseServerEndpointRequest(
            licenseServerEndpointArn: licenseServerEndpointArn, 
            serverType: serverType
        )
        return try await self.deleteLicenseServerEndpoint(input, logger: logger)
    }

    /// Deregisters the Active Directory identity provider from License Manager user-based subscriptions.
    @Sendable
    @inlinable
    public func deregisterIdentityProvider(_ input: DeregisterIdentityProviderRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeregisterIdentityProviderResponse {
        try await self.client.execute(
            operation: "DeregisterIdentityProvider", 
            path: "/identity-provider/DeregisterIdentityProvider", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deregisters the Active Directory identity provider from License Manager user-based subscriptions.
    ///
    /// Parameters:
    ///   - identityProvider: An object that specifies details for the Active Directory identity provider.
    ///   - identityProviderArn: The Amazon Resource Name (ARN) that identifies the identity provider to deregister.
    ///   - product: The name of the user-based subscription product. Valid values: VISUAL_STUDIO_ENTERPRISE | VISUAL_STUDIO_PROFESSIONAL | OFFICE_PROFESSIONAL_PLUS |
    ///   - logger: Logger use during operation
    @inlinable
    public func deregisterIdentityProvider(
        identityProvider: IdentityProvider? = nil,
        identityProviderArn: String? = nil,
        product: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeregisterIdentityProviderResponse {
        let input = DeregisterIdentityProviderRequest(
            identityProvider: identityProvider, 
            identityProviderArn: identityProviderArn, 
            product: product
        )
        return try await self.deregisterIdentityProvider(input, logger: logger)
    }

    /// Disassociates the user from an EC2 instance providing user-based subscriptions.
    @Sendable
    @inlinable
    public func disassociateUser(_ input: DisassociateUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DisassociateUserResponse {
        try await self.client.execute(
            operation: "DisassociateUser", 
            path: "/user/DisassociateUser", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Disassociates the user from an EC2 instance providing user-based subscriptions.
    ///
    /// Parameters:
    ///   - domain: The domain name of the  Active Directory that contains information for the user to disassociate.
    ///   - identityProvider: An object that specifies details for the Active Directory identity provider.
    ///   - instanceId: The ID of the EC2 instance which provides user-based subscriptions.
    ///   - instanceUserArn: The Amazon Resource Name (ARN) of the user to disassociate from the EC2 instance.
    ///   - username: The user name from the Active Directory identity provider for the user.
    ///   - logger: Logger use during operation
    @inlinable
    public func disassociateUser(
        domain: String? = nil,
        identityProvider: IdentityProvider? = nil,
        instanceId: String? = nil,
        instanceUserArn: String? = nil,
        username: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DisassociateUserResponse {
        let input = DisassociateUserRequest(
            domain: domain, 
            identityProvider: identityProvider, 
            instanceId: instanceId, 
            instanceUserArn: instanceUserArn, 
            username: username
        )
        return try await self.disassociateUser(input, logger: logger)
    }

    /// Lists the Active Directory identity providers for user-based subscriptions.
    @Sendable
    @inlinable
    public func listIdentityProviders(_ input: ListIdentityProvidersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListIdentityProvidersResponse {
        try await self.client.execute(
            operation: "ListIdentityProviders", 
            path: "/identity-provider/ListIdentityProviders", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the Active Directory identity providers for user-based subscriptions.
    ///
    /// Parameters:
    ///   - filters: You can use the following filters to streamline results:   Product   DirectoryId
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - nextToken: A token to specify where to start paginating. This is the nextToken
    ///   - logger: Logger use during operation
    @inlinable
    public func listIdentityProviders(
        filters: [Filter]? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListIdentityProvidersResponse {
        let input = ListIdentityProvidersRequest(
            filters: filters, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listIdentityProviders(input, logger: logger)
    }

    /// Lists the EC2 instances providing user-based subscriptions.
    @Sendable
    @inlinable
    public func listInstances(_ input: ListInstancesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListInstancesResponse {
        try await self.client.execute(
            operation: "ListInstances", 
            path: "/instance/ListInstances", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the EC2 instances providing user-based subscriptions.
    ///
    /// Parameters:
    ///   - filters: You can use the following filters to streamline results:   Status   InstanceId
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - nextToken: A token to specify where to start paginating. This is the nextToken
    ///   - logger: Logger use during operation
    @inlinable
    public func listInstances(
        filters: [Filter]? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListInstancesResponse {
        let input = ListInstancesRequest(
            filters: filters, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listInstances(input, logger: logger)
    }

    /// List the Remote Desktop Services (RDS) License Server endpoints
    @Sendable
    @inlinable
    public func listLicenseServerEndpoints(_ input: ListLicenseServerEndpointsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListLicenseServerEndpointsResponse {
        try await self.client.execute(
            operation: "ListLicenseServerEndpoints", 
            path: "/license-server/ListLicenseServerEndpoints", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// List the Remote Desktop Services (RDS) License Server endpoints
    ///
    /// Parameters:
    ///   - filters: You can use the following filters to streamline results:   IdentityProviderArn
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - nextToken: A token to specify where to start paginating. This is the nextToken
    ///   - logger: Logger use during operation
    @inlinable
    public func listLicenseServerEndpoints(
        filters: [Filter]? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListLicenseServerEndpointsResponse {
        let input = ListLicenseServerEndpointsRequest(
            filters: filters, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listLicenseServerEndpoints(input, logger: logger)
    }

    /// Lists the user-based subscription products available from an identity provider.
    @Sendable
    @inlinable
    public func listProductSubscriptions(_ input: ListProductSubscriptionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListProductSubscriptionsResponse {
        try await self.client.execute(
            operation: "ListProductSubscriptions", 
            path: "/user/ListProductSubscriptions", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the user-based subscription products available from an identity provider.
    ///
    /// Parameters:
    ///   - filters: You can use the following filters to streamline results:   Status   Username   Domain
    ///   - identityProvider: An object that specifies details for the identity provider.
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - nextToken: A token to specify where to start paginating. This is the nextToken
    ///   - product: The name of the user-based subscription product. Valid values: VISUAL_STUDIO_ENTERPRISE | VISUAL_STUDIO_PROFESSIONAL | OFFICE_PROFESSIONAL_PLUS |
    ///   - logger: Logger use during operation
    @inlinable
    public func listProductSubscriptions(
        filters: [Filter]? = nil,
        identityProvider: IdentityProvider,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        product: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListProductSubscriptionsResponse {
        let input = ListProductSubscriptionsRequest(
            filters: filters, 
            identityProvider: identityProvider, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            product: product
        )
        return try await self.listProductSubscriptions(input, logger: logger)
    }

    /// Returns the list of tags for the specified resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the list of tags for the specified resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Lists user associations for an identity provider.
    @Sendable
    @inlinable
    public func listUserAssociations(_ input: ListUserAssociationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListUserAssociationsResponse {
        try await self.client.execute(
            operation: "ListUserAssociations", 
            path: "/user/ListUserAssociations", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists user associations for an identity provider.
    ///
    /// Parameters:
    ///   - filters: You can use the following filters to streamline results:   Status   Username   Domain
    ///   - identityProvider: An object that specifies details for the identity provider.
    ///   - instanceId: The ID of the EC2 instance, which provides user-based subscriptions.
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - nextToken: A token to specify where to start paginating. This is the nextToken
    ///   - logger: Logger use during operation
    @inlinable
    public func listUserAssociations(
        filters: [Filter]? = nil,
        identityProvider: IdentityProvider,
        instanceId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListUserAssociationsResponse {
        let input = ListUserAssociationsRequest(
            filters: filters, 
            identityProvider: identityProvider, 
            instanceId: instanceId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listUserAssociations(input, logger: logger)
    }

    /// Registers an identity provider for user-based subscriptions.
    @Sendable
    @inlinable
    public func registerIdentityProvider(_ input: RegisterIdentityProviderRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> RegisterIdentityProviderResponse {
        try await self.client.execute(
            operation: "RegisterIdentityProvider", 
            path: "/identity-provider/RegisterIdentityProvider", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Registers an identity provider for user-based subscriptions.
    ///
    /// Parameters:
    ///   - identityProvider: An object that specifies details for the identity provider to register.
    ///   - product: The name of the user-based subscription product. Valid values: VISUAL_STUDIO_ENTERPRISE | VISUAL_STUDIO_PROFESSIONAL | OFFICE_PROFESSIONAL_PLUS |
    ///   - settings: The registered identity provider’s product related configuration
    ///   - tags: The tags that apply to the identity provider's registration.
    ///   - logger: Logger use during operation
    @inlinable
    public func registerIdentityProvider(
        identityProvider: IdentityProvider,
        product: String,
        settings: Settings? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> RegisterIdentityProviderResponse {
        let input = RegisterIdentityProviderRequest(
            identityProvider: identityProvider, 
            product: product, 
            settings: settings, 
            tags: tags
        )
        return try await self.registerIdentityProvider(input, logger: logger)
    }

    /// Starts a product subscription for a user with the specified identity provider.  Your estimated bill for charges on the number of users and related costs will take 48
    /// 			hours to appear for billing periods that haven't closed (marked as Pending billing status) in Amazon Web Services Billing. For more information, see Viewing your
    /// 				monthly charges in the Amazon Web Services Billing User Guide.
    @Sendable
    @inlinable
    public func startProductSubscription(_ input: StartProductSubscriptionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartProductSubscriptionResponse {
        try await self.client.execute(
            operation: "StartProductSubscription", 
            path: "/user/StartProductSubscription", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts a product subscription for a user with the specified identity provider.  Your estimated bill for charges on the number of users and related costs will take 48
    /// 			hours to appear for billing periods that haven't closed (marked as Pending billing status) in Amazon Web Services Billing. For more information, see Viewing your
    /// 				monthly charges in the Amazon Web Services Billing User Guide.
    ///
    /// Parameters:
    ///   - domain: The domain name of the  Active Directory that contains the user for whom to start the product
    ///   - identityProvider: An object that specifies details for the identity provider.
    ///   - product: The name of the user-based subscription product. Valid values: VISUAL_STUDIO_ENTERPRISE | VISUAL_STUDIO_PROFESSIONAL | OFFICE_PROFESSIONAL_PLUS |
    ///   - tags: The tags that apply to the product subscription.
    ///   - username: The user name from the identity provider of the user.
    ///   - logger: Logger use during operation
    @inlinable
    public func startProductSubscription(
        domain: String? = nil,
        identityProvider: IdentityProvider,
        product: String,
        tags: [String: String]? = nil,
        username: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartProductSubscriptionResponse {
        let input = StartProductSubscriptionRequest(
            domain: domain, 
            identityProvider: identityProvider, 
            product: product, 
            tags: tags, 
            username: username
        )
        return try await self.startProductSubscription(input, logger: logger)
    }

    /// Stops a product subscription for a user with the specified identity provider.
    @Sendable
    @inlinable
    public func stopProductSubscription(_ input: StopProductSubscriptionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StopProductSubscriptionResponse {
        try await self.client.execute(
            operation: "StopProductSubscription", 
            path: "/user/StopProductSubscription", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Stops a product subscription for a user with the specified identity provider.
    ///
    /// Parameters:
    ///   - domain: The domain name of the  Active Directory that contains the user for whom to stop the product
    ///   - identityProvider: An object that specifies details for the identity provider.
    ///   - product: The name of the user-based subscription product. Valid values: VISUAL_STUDIO_ENTERPRISE | VISUAL_STUDIO_PROFESSIONAL | OFFICE_PROFESSIONAL_PLUS |
    ///   - productUserArn: The Amazon Resource Name (ARN) of the product user.
    ///   - username: The user name from the identity provider for the user.
    ///   - logger: Logger use during operation
    @inlinable
    public func stopProductSubscription(
        domain: String? = nil,
        identityProvider: IdentityProvider? = nil,
        product: String? = nil,
        productUserArn: String? = nil,
        username: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StopProductSubscriptionResponse {
        let input = StopProductSubscriptionRequest(
            domain: domain, 
            identityProvider: identityProvider, 
            product: product, 
            productUserArn: productUserArn, 
            username: username
        )
        return try await self.stopProductSubscription(input, logger: logger)
    }

    /// Adds tags to a resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds tags to a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource that you want to tag.
    ///   - tags: The tags to apply to the specified resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes tags from a resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes tags from a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource that you want to remove tags from.
    ///   - tagKeys: The tag keys to remove from the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates additional product configuration settings for the registered identity
    /// 			provider.
    @Sendable
    @inlinable
    public func updateIdentityProviderSettings(_ input: UpdateIdentityProviderSettingsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateIdentityProviderSettingsResponse {
        try await self.client.execute(
            operation: "UpdateIdentityProviderSettings", 
            path: "/identity-provider/UpdateIdentityProviderSettings", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates additional product configuration settings for the registered identity
    /// 			provider.
    ///
    /// Parameters:
    ///   - identityProvider: 
    ///   - identityProviderArn: The Amazon Resource Name (ARN) of the identity provider to update.
    ///   - product: The name of the user-based subscription product. Valid values: VISUAL_STUDIO_ENTERPRISE | VISUAL_STUDIO_PROFESSIONAL | OFFICE_PROFESSIONAL_PLUS |
    ///   - updateSettings: Updates the registered identity provider’s product related configuration settings. You can
    ///   - logger: Logger use during operation
    @inlinable
    public func updateIdentityProviderSettings(
        identityProvider: IdentityProvider? = nil,
        identityProviderArn: String? = nil,
        product: String? = nil,
        updateSettings: UpdateSettings,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateIdentityProviderSettingsResponse {
        let input = UpdateIdentityProviderSettingsRequest(
            identityProvider: identityProvider, 
            identityProviderArn: identityProviderArn, 
            product: product, 
            updateSettings: updateSettings
        )
        return try await self.updateIdentityProviderSettings(input, logger: logger)
    }
}

extension LicenseManagerUserSubscriptions {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: LicenseManagerUserSubscriptions, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension LicenseManagerUserSubscriptions {
    /// Return PaginatorSequence for operation ``listIdentityProviders(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listIdentityProvidersPaginator(
        _ input: ListIdentityProvidersRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListIdentityProvidersRequest, ListIdentityProvidersResponse> {
        return .init(
            input: input,
            command: self.listIdentityProviders,
            inputKey: \ListIdentityProvidersRequest.nextToken,
            outputKey: \ListIdentityProvidersResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listIdentityProviders(_:logger:)``.
    ///
    /// - Parameters:
    ///   - filters: You can use the following filters to streamline results:   Product   DirectoryId
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - logger: Logger used for logging
    @inlinable
    public func listIdentityProvidersPaginator(
        filters: [Filter]? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListIdentityProvidersRequest, ListIdentityProvidersResponse> {
        let input = ListIdentityProvidersRequest(
            filters: filters, 
            maxResults: maxResults
        )
        return self.listIdentityProvidersPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listInstances(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listInstancesPaginator(
        _ input: ListInstancesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListInstancesRequest, ListInstancesResponse> {
        return .init(
            input: input,
            command: self.listInstances,
            inputKey: \ListInstancesRequest.nextToken,
            outputKey: \ListInstancesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listInstances(_:logger:)``.
    ///
    /// - Parameters:
    ///   - filters: You can use the following filters to streamline results:   Status   InstanceId
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - logger: Logger used for logging
    @inlinable
    public func listInstancesPaginator(
        filters: [Filter]? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListInstancesRequest, ListInstancesResponse> {
        let input = ListInstancesRequest(
            filters: filters, 
            maxResults: maxResults
        )
        return self.listInstancesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listLicenseServerEndpoints(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listLicenseServerEndpointsPaginator(
        _ input: ListLicenseServerEndpointsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListLicenseServerEndpointsRequest, ListLicenseServerEndpointsResponse> {
        return .init(
            input: input,
            command: self.listLicenseServerEndpoints,
            inputKey: \ListLicenseServerEndpointsRequest.nextToken,
            outputKey: \ListLicenseServerEndpointsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listLicenseServerEndpoints(_:logger:)``.
    ///
    /// - Parameters:
    ///   - filters: You can use the following filters to streamline results:   IdentityProviderArn
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - logger: Logger used for logging
    @inlinable
    public func listLicenseServerEndpointsPaginator(
        filters: [Filter]? = nil,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListLicenseServerEndpointsRequest, ListLicenseServerEndpointsResponse> {
        let input = ListLicenseServerEndpointsRequest(
            filters: filters, 
            maxResults: maxResults
        )
        return self.listLicenseServerEndpointsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listProductSubscriptions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listProductSubscriptionsPaginator(
        _ input: ListProductSubscriptionsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListProductSubscriptionsRequest, ListProductSubscriptionsResponse> {
        return .init(
            input: input,
            command: self.listProductSubscriptions,
            inputKey: \ListProductSubscriptionsRequest.nextToken,
            outputKey: \ListProductSubscriptionsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listProductSubscriptions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - filters: You can use the following filters to streamline results:   Status   Username   Domain
    ///   - identityProvider: An object that specifies details for the identity provider.
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - product: The name of the user-based subscription product. Valid values: VISUAL_STUDIO_ENTERPRISE | VISUAL_STUDIO_PROFESSIONAL | OFFICE_PROFESSIONAL_PLUS |
    ///   - logger: Logger used for logging
    @inlinable
    public func listProductSubscriptionsPaginator(
        filters: [Filter]? = nil,
        identityProvider: IdentityProvider,
        maxResults: Int? = nil,
        product: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListProductSubscriptionsRequest, ListProductSubscriptionsResponse> {
        let input = ListProductSubscriptionsRequest(
            filters: filters, 
            identityProvider: identityProvider, 
            maxResults: maxResults, 
            product: product
        )
        return self.listProductSubscriptionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listUserAssociations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listUserAssociationsPaginator(
        _ input: ListUserAssociationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListUserAssociationsRequest, ListUserAssociationsResponse> {
        return .init(
            input: input,
            command: self.listUserAssociations,
            inputKey: \ListUserAssociationsRequest.nextToken,
            outputKey: \ListUserAssociationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listUserAssociations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - filters: You can use the following filters to streamline results:   Status   Username   Domain
    ///   - identityProvider: An object that specifies details for the identity provider.
    ///   - instanceId: The ID of the EC2 instance, which provides user-based subscriptions.
    ///   - maxResults: The maximum number of results to return from a single request.
    ///   - logger: Logger used for logging
    @inlinable
    public func listUserAssociationsPaginator(
        filters: [Filter]? = nil,
        identityProvider: IdentityProvider,
        instanceId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListUserAssociationsRequest, ListUserAssociationsResponse> {
        let input = ListUserAssociationsRequest(
            filters: filters, 
            identityProvider: identityProvider, 
            instanceId: instanceId, 
            maxResults: maxResults
        )
        return self.listUserAssociationsPaginator(input, logger: logger)
    }
}

extension LicenseManagerUserSubscriptions.ListIdentityProvidersRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> LicenseManagerUserSubscriptions.ListIdentityProvidersRequest {
        return .init(
            filters: self.filters,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension LicenseManagerUserSubscriptions.ListInstancesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> LicenseManagerUserSubscriptions.ListInstancesRequest {
        return .init(
            filters: self.filters,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension LicenseManagerUserSubscriptions.ListLicenseServerEndpointsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> LicenseManagerUserSubscriptions.ListLicenseServerEndpointsRequest {
        return .init(
            filters: self.filters,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension LicenseManagerUserSubscriptions.ListProductSubscriptionsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> LicenseManagerUserSubscriptions.ListProductSubscriptionsRequest {
        return .init(
            filters: self.filters,
            identityProvider: self.identityProvider,
            maxResults: self.maxResults,
            nextToken: token,
            product: self.product
        )
    }
}

extension LicenseManagerUserSubscriptions.ListUserAssociationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> LicenseManagerUserSubscriptions.ListUserAssociationsRequest {
        return .init(
            filters: self.filters,
            identityProvider: self.identityProvider,
            instanceId: self.instanceId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
